<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>在你的hexo博客上使用“程序员老黄历” | 沐の空间</title><meta name="keywords" content="hexo"><meta name="author" content="White_mu,WhitemuTeam@outlook.com"><meta name="copyright" content="White_mu"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="在你的hexo博客上使用“程序员老黄历”注意：1.“程序员老黄历”来源于runjs.cn（http:&#x2F;&#x2F;sandbox.runjs.cn&#x2F;show&#x2F;ydp3it7b ） ，作者：Yiding He 项目源码有标明 2.作者和White_mu均不对“老黄历”所产生的内容负责   导入：请在blog目录下的source文件夹创建一个新的文件夹，名字自拟 在新文件夹中创建以下文件： Programmer">
<meta property="og:type" content="article">
<meta property="og:title" content="在你的hexo博客上使用“程序员老黄历”">
<meta property="og:url" content="https://muspace.top/posts/54870/index.html">
<meta property="og:site_name" content="沐の空间">
<meta property="og:description" content="在你的hexo博客上使用“程序员老黄历”注意：1.“程序员老黄历”来源于runjs.cn（http:&#x2F;&#x2F;sandbox.runjs.cn&#x2F;show&#x2F;ydp3it7b ） ，作者：Yiding He 项目源码有标明 2.作者和White_mu均不对“老黄历”所产生的内容负责   导入：请在blog目录下的source文件夹创建一个新的文件夹，名字自拟 在新文件夹中创建以下文件： Programmer">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/WhitemuTeam/web-img/img/78413548.jpg">
<meta property="article:published_time" content="2021-07-01T04:50:00.000Z">
<meta property="article:modified_time" content="2021-07-01T04:50:00.000Z">
<meta property="article:author" content="White_mu">
<meta property="article:tag" content="hexo">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/WhitemuTeam/web-img/img/78413548.jpg"><link rel="shortcut icon" href="/img/Oldfavicon.png"><link rel="canonical" href="https://muspace.top/posts/54870/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//www.google-analytics.com" crossorigin=""/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-ZVRBXJ2DLK"></script><script>window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-ZVRBXJ2DLK');
</script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-left"},
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-07-01 12:50:00'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
          const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
          const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
          const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified

          if (t === undefined) {
            if (isLightMode) activateLightMode()
            else if (isDarkMode) activateDarkMode()
            else if (isNotSpecified || hasNoSupport) {
              const now = new Date()
              const hour = now.getHours()
              const isNight = hour <= 6 || hour >= 18
              isNight ? activateDarkMode() : activateLightMode()
            }
            window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
              if (saveToLocal.get('theme') === undefined) {
                e.matches ? activateDarkMode() : activateLightMode()
              }
            })
          } else if (t === 'light') activateLightMode()
          else activateDarkMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    })(window)</script><link rel="stylesheet" href="//at.alicdn.com/t/font_2594570_i6c7w02fsw.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"><style>#aside-content .card-info .card-info-social-icons i { position: inherit !important}</style><style>#aside-content .card-info .button--animated i { position: inherit !important}</style><script src="/live2d-widget/autoload.js"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zyoushuo/Blog@latest/hexo/css/loading_style_1.css" ><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zyoushuo/Blog@latest/hexo/css/loading_style_2.css" ><script src="/live2d-widget/autoload.js"></script><!-- hexo injector head_end start --><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hexo-butterfly-artitalk-pro/lib/card.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/atom.xml" title="沐の空间" type="application/atom+xml">
</head><body>
<div id='loader'>
    
    <div class="outer_box">
    <div class='loader_overlay'></div>
    <div class='loader_cogs'>
        <div class='loader_cogs__top'>
            <div class='top_part'></div>
            <div class='top_part'></div>
            <div class='top_part'></div>
            <div class='top_hole'></div>
        </div>
        <div class='loader_cogs__left'>
            <div class='left_part'></div>
            <div class='left_part'></div>
            <div class='left_part'></div>
            <div class='left_hole'></div>
        </div>
        <div class='loader_cogs__bottom'>
            <div class='bottom_part'></div>
            <div class='bottom_part'></div>
            <div class='bottom_part'></div>
            <div class='bottom_hole'></div>
        </div>
        <p style="text-align:center">&nbsp;&nbsp;&nbsp;loading...</p>
    </div>
    </div>
  
</div>

<script>
  var endLoading = function () {
    document.body.style.overflow = 'auto';
    document.getElementById('loader').classList.add("loading");
  }
  window.addEventListener('load',endLoading);
</script>
<div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="/img/head.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">49</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">20</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">20</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/artitalk/"><i class="fa-fw iconfont icon-sticky-note-line"></i><span> 碎碎念</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa-fw fa fa-book"></i><span> 文章</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> 标签</span></a></li><li><a class="site-page" href="/categories/"><i class="fa-fw fa fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page" href="/archives/"><i class="fa-fw fa fa-archive"></i><span> 时间轴</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa fa-link"></i><span> 链接</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/link/"><i class="fa-fw fa fa-users"></i><span> 友情链接</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://space.bilibili.com/97020216"><i class="fa-fw iconfont icon-bilibili-line"></i><span> Bilibili个人主页</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa fa-list"></i><span> 菜单</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/about/"><i class="fa-fw fa fa-heart"></i><span> 关于</span></a></li><li><a class="site-page" href="/lab/ProgrammersYellowCalender"><i class="fa-fw iconfont icon-calendar-2-line"></i><span> 程序员老黄历</span></a></li><li><a class="site-page" href="/jump/"><i class="fa-fw iconfont icon-web"></i><span> 文章导航</span></a></li></ul></div><div class="menus_item"><a class="site-page" target="_blank" rel="noopener" href="https://travellings.link"><i class="fa-fw fa fa-subway"></i><span> 开往</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://cdn.jsdelivr.net/gh/WhitemuTeam/web-img/img/78413548.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">沐の空间</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/artitalk/"><i class="fa-fw iconfont icon-sticky-note-line"></i><span> 碎碎念</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa-fw fa fa-book"></i><span> 文章</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> 标签</span></a></li><li><a class="site-page" href="/categories/"><i class="fa-fw fa fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page" href="/archives/"><i class="fa-fw fa fa-archive"></i><span> 时间轴</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa fa-link"></i><span> 链接</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/link/"><i class="fa-fw fa fa-users"></i><span> 友情链接</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://space.bilibili.com/97020216"><i class="fa-fw iconfont icon-bilibili-line"></i><span> Bilibili个人主页</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa fa-list"></i><span> 菜单</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/about/"><i class="fa-fw fa fa-heart"></i><span> 关于</span></a></li><li><a class="site-page" href="/lab/ProgrammersYellowCalender"><i class="fa-fw iconfont icon-calendar-2-line"></i><span> 程序员老黄历</span></a></li><li><a class="site-page" href="/jump/"><i class="fa-fw iconfont icon-web"></i><span> 文章导航</span></a></li></ul></div><div class="menus_item"><a class="site-page" target="_blank" rel="noopener" href="https://travellings.link"><i class="fa-fw fa fa-subway"></i><span> 开往</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">在你的hexo博客上使用“程序员老黄历”</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-07-01T04:50:00.000Z" title="发表于 2021-07-01 12:50:00">2021-07-01</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-07-01T04:50:00.000Z" title="更新于 2021-07-01 12:50:00">2021-07-01</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/hexo/">hexo</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">4k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>20分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="在你的hexo博客上使用“程序员老黄历”"><a href="#在你的hexo博客上使用“程序员老黄历”" class="headerlink" title="在你的hexo博客上使用“程序员老黄历”"></a>在你的hexo博客上使用“程序员老黄历”</h1><div class="note warning flat"><p>注意：1.“程序员老黄历”来源于runjs.cn（<a target="_blank" rel="noopener" href="http://sandbox.runjs.cn/show/ydp3it7b">http://sandbox.runjs.cn/show/ydp3it7b</a> ） ，作者：Yiding He 项目源码有标明 2.作者和White_mu均不对“老黄历”所产生的内容负责</p>
</div>

<h1 id="导入："><a href="#导入：" class="headerlink" title="导入："></a>导入：</h1><p>请在blog目录下的source文件夹创建一个新的文件夹，名字自拟</p>
<p>在新文件夹中创建以下文件：</p>
<p><code>ProgrammersYellowCalender.htm</code>（可自拟）：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&lt;!DOCTYPE <span class="meta-keyword">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">head</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">http-equiv</span>=<span class="string">&quot;Content-Type&quot;</span> <span class="attr">content</span>=<span class="string">&quot;text/html; charset=UTF-8&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">description</span>=<span class="string">&quot;runjs.cn 首发，求好看的 CSS&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">description</span>=<span class="string">&quot;信则有，不信则无，总之作者不会对该程序生成的内容负任何责任。&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">description</span>=<span class="string">&quot;虽然在微博发现冒充原作者的账号，但不想打击大家 fork 的热情，所以页面上不会有任何关于作者的声明。&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">author</span>=<span class="string">&quot;twitter: @fake_faith, G+: Yiding He&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">name</span>=<span class="string">&quot;viewport&quot;</span> <span class="attr">content</span>=<span class="string">&quot;width=device-width, initial-scale=1, maximum-scale=1&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">title</span>&gt;</span>程序员老黄历<span class="tag">&lt;/<span class="name">title</span>&gt;</span></span><br><span class="line">    <span class="comment">&lt;!--&lt;script id=&quot;jquery_183&quot; type=&quot;text/javascript&quot; class=&quot;library&quot; src=&quot;/js/sandbox/jquery/jquery-1.8.3.min.js&quot;&gt;&lt;/script&gt;--&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">head</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">link</span> <span class="attr">rel</span>=<span class="string">&quot;stylesheet&quot;</span> <span class="attr">type</span>=<span class="string">&quot;text/css&quot;</span> <span class="attr">href</span>=<span class="string">&quot;Calender.css&quot;</span>/&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;DivergenceMeter.js&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;container&quot;</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;title&quot;</span>&gt;</span></span><br><span class="line">                程序员老黄历<span class="tag">&lt;<span class="name">sup</span>&gt;</span><span class="tag">&lt;/<span class="name">sup</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;date&quot;</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;good&quot;</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;title&quot;</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;<span class="name">table</span>&gt;</span></span><br><span class="line">                        <span class="tag">&lt;<span class="name">tr</span>&gt;</span><span class="tag">&lt;<span class="name">td</span>&gt;</span>宜<span class="tag">&lt;/<span class="name">td</span>&gt;</span><span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;/<span class="name">table</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;content&quot;</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;<span class="name">ul</span>&gt;</span><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;clear&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;split&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;bad&quot;</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;title&quot;</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;<span class="name">table</span>&gt;</span></span><br><span class="line">                        <span class="tag">&lt;<span class="name">tr</span>&gt;</span><span class="tag">&lt;<span class="name">td</span>&gt;</span>不宜<span class="tag">&lt;/<span class="name">td</span>&gt;</span><span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;/<span class="name">table</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;content&quot;</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;<span class="name">ul</span>&gt;</span><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;clear&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;split&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;line-tip&quot;</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">strong</span>&gt;</span>座位朝向：<span class="tag">&lt;/<span class="name">strong</span>&gt;</span>面向<span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;direction_value&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span>写程序，BUG 最少。</span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;line-tip&quot;</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">strong</span>&gt;</span>今日宜饮：<span class="tag">&lt;/<span class="name">strong</span>&gt;</span><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;drink_value&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;line-tip&quot;</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">strong</span>&gt;</span>女神亲近指数：<span class="tag">&lt;/<span class="name">strong</span>&gt;</span><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;goddes_value&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line"></span><br><span class="line">            <span class="comment">&lt;!--&lt;div class=&quot;comment&quot;&gt;</span></span><br><span class="line"><span class="comment">                &lt;ul&gt;</span></span><br><span class="line"><span class="comment">                    &lt;li&gt;本老黄历尚处于beta阶段，作者随时会修改，所以如果上午看到的内容跟下午不同，请勿惊慌；&lt;/li&gt;</span></span><br><span class="line"><span class="comment">                    &lt;li&gt;本老黄历仅面向程序员；&lt;/li&gt;</span></span><br><span class="line"><span class="comment">                    &lt;li&gt;本老黄历内容是程序生成的，因为只有这样程序员才会信。&lt;/li&gt;</span></span><br><span class="line"><span class="comment">                &lt;/ul&gt;</span></span><br><span class="line"><span class="comment">            &lt;/div&gt;--&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line">				<span class="tag">&lt;<span class="name">li</span>&gt;</span>原作者：Yiding He<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure>

<p>当然，你也可以略为修改，比如像这样：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&lt;!DOCTYPE <span class="meta-keyword">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">head</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">http-equiv</span>=<span class="string">&quot;Content-Type&quot;</span> <span class="attr">content</span>=<span class="string">&quot;text/html; charset=UTF-8&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">description</span>=<span class="string">&quot;runjs.cn 首发，求好看的 CSS&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">description</span>=<span class="string">&quot;信则有，不信则无，总之作者不会对该程序生成的内容负任何责任。&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">description</span>=<span class="string">&quot;虽然在微博发现冒充原作者的账号，但不想打击大家 fork 的热情，所以页面上不会有任何关于作者的声明。&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">author</span>=<span class="string">&quot;twitter: @fake_faith, G+: Yiding He; Transplantation: Whitemu_mu&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">name</span>=<span class="string">&quot;viewport&quot;</span> <span class="attr">content</span>=<span class="string">&quot;width=device-width, initial-scale=1, maximum-scale=1&quot;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">title</span>&gt;</span>程序员老黄历<span class="tag">&lt;/<span class="name">title</span>&gt;</span></span><br><span class="line">    <span class="comment">&lt;!--&lt;script id=&quot;jquery_183&quot; type=&quot;text/javascript&quot; class=&quot;library&quot; src=&quot;/js/sandbox/jquery/jquery-1.8.3.min.js&quot;&gt;&lt;/script&gt;--&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">head</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">link</span> <span class="attr">rel</span>=<span class="string">&quot;stylesheet&quot;</span> <span class="attr">type</span>=<span class="string">&quot;text/css&quot;</span> <span class="attr">href</span>=<span class="string">&quot;Calender.css&quot;</span>/&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;DivergenceMeter.js&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;container&quot;</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;title&quot;</span>&gt;</span></span><br><span class="line">                程序员老黄历<span class="tag">&lt;<span class="name">sup</span>&gt;</span><span class="tag">&lt;/<span class="name">sup</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;date&quot;</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;good&quot;</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;title&quot;</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;<span class="name">table</span>&gt;</span></span><br><span class="line">                        <span class="tag">&lt;<span class="name">tr</span>&gt;</span><span class="tag">&lt;<span class="name">td</span>&gt;</span>宜<span class="tag">&lt;/<span class="name">td</span>&gt;</span><span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;/<span class="name">table</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;content&quot;</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;<span class="name">ul</span>&gt;</span><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;clear&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;split&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;bad&quot;</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;title&quot;</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;<span class="name">table</span>&gt;</span></span><br><span class="line">                        <span class="tag">&lt;<span class="name">tr</span>&gt;</span><span class="tag">&lt;<span class="name">td</span>&gt;</span>不宜<span class="tag">&lt;/<span class="name">td</span>&gt;</span><span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;/<span class="name">table</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;content&quot;</span>&gt;</span></span><br><span class="line">                    <span class="tag">&lt;<span class="name">ul</span>&gt;</span><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;clear&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;split&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;line-tip&quot;</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">strong</span>&gt;</span>座位朝向：<span class="tag">&lt;/<span class="name">strong</span>&gt;</span>面向<span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;direction_value&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span>写程序，BUG 最少。</span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;line-tip&quot;</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">strong</span>&gt;</span>今日宜饮：<span class="tag">&lt;/<span class="name">strong</span>&gt;</span><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;drink_value&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;line-tip&quot;</span>&gt;</span></span><br><span class="line">                <span class="tag">&lt;<span class="name">strong</span>&gt;</span>女神亲近指数：<span class="tag">&lt;/<span class="name">strong</span>&gt;</span><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;goddes_value&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line"></span><br><span class="line">            <span class="comment">&lt;!--&lt;div class=&quot;comment&quot;&gt;</span></span><br><span class="line"><span class="comment">                &lt;ul&gt;</span></span><br><span class="line"><span class="comment">                    &lt;li&gt;本老黄历尚处于beta阶段，作者随时会修改，所以如果上午看到的内容跟下午不同，请勿惊慌；&lt;/li&gt;</span></span><br><span class="line"><span class="comment">                    &lt;li&gt;本老黄历仅面向程序员；&lt;/li&gt;</span></span><br><span class="line"><span class="comment">                    &lt;li&gt;本老黄历内容是程序生成的，因为只有这样程序员才会信。&lt;/li&gt;</span></span><br><span class="line"><span class="comment">                &lt;/ul&gt;</span></span><br><span class="line"><span class="comment">            &lt;/div&gt;--&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line">				<span class="tag">&lt;<span class="name">li</span>&gt;</span>原作者：Yiding He；移植: White_mu。 本页面生成的结果仅供参考，White_mu不对此页面生成的内容负责<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure>

<p>创建<code>DivergenceMeter.js</code>：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br></pre></td><td class="code"><pre><span class="line">   <span class="comment">//</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment"> * 注意：本程序中的“随机”都是伪随机概念，以当前的天为种子。</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">random</span>(<span class="params">dayseed, indexseed</span>) </span>&#123;</span><br><span class="line">    <span class="keyword">var</span> n = dayseed % <span class="number">11117</span>;</span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; <span class="number">100</span> + indexseed; i++) &#123;</span><br><span class="line">        n = n * n;</span><br><span class="line">        n = n % <span class="number">11117</span>;   <span class="comment">// 11117 是个质数</span></span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> n;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> today = <span class="keyword">new</span> <span class="built_in">Date</span>();</span><br><span class="line"><span class="keyword">var</span> iday = today.getFullYear() * <span class="number">10000</span> + (today.getMonth() + <span class="number">1</span>) * <span class="number">100</span> + today.getDate();</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> weeks = [<span class="string">&quot;日&quot;</span>,<span class="string">&quot;一&quot;</span>,<span class="string">&quot;二&quot;</span>,<span class="string">&quot;三&quot;</span>,<span class="string">&quot;四&quot;</span>,<span class="string">&quot;五&quot;</span>,<span class="string">&quot;六&quot;</span>];</span><br><span class="line"><span class="keyword">var</span> directions = [<span class="string">&quot;北方&quot;</span>,<span class="string">&quot;东北方&quot;</span>,<span class="string">&quot;东方&quot;</span>,<span class="string">&quot;东南方&quot;</span>,<span class="string">&quot;南方&quot;</span>,<span class="string">&quot;西南方&quot;</span>,<span class="string">&quot;西方&quot;</span>,<span class="string">&quot;西北方&quot;</span>];</span><br><span class="line"><span class="keyword">var</span> activities = [</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;写单元测试&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;写单元测试将减少出错&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;写单元测试会降低你的开发效率&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;洗澡&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;你几天没洗澡了？&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;会把设计方面的灵感洗掉&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;锻炼一下身体&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;能量没消耗多少，吃得却更多&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;抽烟&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;抽烟有利于提神，增加思维敏捷&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;除非你活够了，死得早点没关系&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;白天上线&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;今天白天上线是安全的&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;可能导致灾难性后果&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;重构&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;代码质量得到提高&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;你很有可能会陷入泥潭&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;使用%t&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;你看起来更有品位&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;别人会觉得你在装逼&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;跳槽&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;该放手时就放手&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;鉴于当前的经济形势，你的下一份工作未必比现在强&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;招人&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;你面前这位有成为牛人的潜质&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;这人会写程序吗？&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;面试&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;面试官今天心情很好&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;面试官不爽，会拿你出气&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;提交辞职申请&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;公司找到了一个比你更能干更便宜的家伙，巴不得你赶快滚蛋&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;鉴于当前的经济形势，你的下一份工作未必比现在强&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;申请加薪&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;老板今天心情很好&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;公司正在考虑裁员&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;晚上加班&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;晚上是程序员精神最好的时候&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;在妹子面前吹牛&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;改善你矮穷挫的形象&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;会被识破&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;WTMSB&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;避免缓冲区溢出&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;强*灰飞烟灭&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;浏览P站&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;重拾对生活的信心&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;你会心神不宁&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;命名变量\&quot;%v\&quot;&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;写超过%l行的方法&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;你的代码组织的很好，长一点没关系&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;你的代码将混乱不堪，你自己都看不懂&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;提交代码&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;遇到冲突的几率是最低的&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;你遇到的一大堆冲突会让你觉得自己是不是时间穿越了&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;代码复审&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;发现重要问题的几率大大增加&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;你什么问题都发现不了，白白浪费时间&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;开会&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;写代码之余放松一下打个盹，有益健康&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;小心被扣屎盆子背黑锅&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;打DOTA&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;你将有如神助&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;你会被虐的很惨&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;晚上上线&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;晚上是程序员精神最好的时候&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;你白天已经筋疲力尽了&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;修复BUG&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;你今天对BUG的嗅觉大大提高&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;新产生的BUG将比修复的更多&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;设计评审&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;设计评审会议将变成头脑风暴&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;人人筋疲力尽，评审就这么过了&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;需求评审&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;&quot;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;上微博&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;今天发生的事不能错过&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;今天的微博充满负能量&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;上AB站&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;还需要理由吗？&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;满屏兄贵亮瞎你的眼&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>:<span class="string">&quot;玩FlappyBird&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;今天破纪录的几率很高&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;除非你想玩到把手机砸了&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;</span><br><span class="line">];</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> specials = [</span><br><span class="line">    &#123;<span class="attr">date</span>:today.getFullYear() * <span class="number">10000</span> + <span class="number">1024</span> , <span class="attr">type</span>:<span class="string">&#x27;bad&#x27;</span>, <span class="attr">name</span>:<span class="string">&#x27;加班&#x27;</span>, <span class="attr">description</span>:<span class="string">&#x27;#996.icu#&#x27;</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">date</span>:today.getFullYear() * <span class="number">10000</span> + <span class="number">514</span> , <span class="attr">type</span>:<span class="string">&#x27;good&#x27;</span> , <span class="attr">name</span>:<span class="string">&#x27;拜访守矢神社&#x27;</span>, <span class="attr">description</span>:<span class="string">&#x27;有机会和一位淡绿发的少女相遇，然后……&#x27;</span>&#125;,</span><br><span class="line">];</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> tools = [<span class="string">&quot;Eclipse写程序&quot;</span>, <span class="string">&quot;MSOffice写文档&quot;</span>, <span class="string">&quot;记事本写程序&quot;</span>, <span class="string">&quot;Windows10&quot;</span>, <span class="string">&quot;Linux&quot;</span>, <span class="string">&quot;MacOS&quot;</span>, <span class="string">&quot;IE&quot;</span>, <span class="string">&quot;Android设备&quot;</span>, <span class="string">&quot;iOS设备&quot;</span>];</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> varNames = [<span class="string">&quot;jieguo&quot;</span>, <span class="string">&quot;huodong&quot;</span>, <span class="string">&quot;pay&quot;</span>, <span class="string">&quot;expire&quot;</span>, <span class="string">&quot;zhangdan&quot;</span>, <span class="string">&quot;every&quot;</span>, <span class="string">&quot;free&quot;</span>, <span class="string">&quot;i1&quot;</span>, <span class="string">&quot;a&quot;</span>, <span class="string">&quot;virtual&quot;</span>, <span class="string">&quot;ad&quot;</span>, <span class="string">&quot;spider&quot;</span>, <span class="string">&quot;mima&quot;</span>, <span class="string">&quot;pass&quot;</span>, <span class="string">&quot;ui&quot;</span>];</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> drinks = [<span class="string">&quot;水&quot;</span>,<span class="string">&quot;茶&quot;</span>,<span class="string">&quot;红茶&quot;</span>,<span class="string">&quot;绿茶&quot;</span>,<span class="string">&quot;咖啡&quot;</span>,<span class="string">&quot;奶茶&quot;</span>,<span class="string">&quot;可乐&quot;</span>,<span class="string">&quot;鲜奶&quot;</span>,<span class="string">&quot;豆奶&quot;</span>,<span class="string">&quot;果汁&quot;</span>,<span class="string">&quot;果味汽水&quot;</span>,<span class="string">&quot;苏打水&quot;</span>,<span class="string">&quot;运动饮料&quot;</span>,<span class="string">&quot;酸奶&quot;</span>,<span class="string">&quot;酒&quot;</span>];</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">is_someday</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> today.getMonth() == <span class="number">5</span> &amp;&amp; today.getDate() == <span class="number">4</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">getTodayString</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> <span class="string">&quot;今天是&quot;</span> + today.getFullYear() + <span class="string">&quot;年&quot;</span> + (today.getMonth() + <span class="number">1</span>) + <span class="string">&quot;月&quot;</span> + today.getDate() + <span class="string">&quot;日 星期&quot;</span> + weeks[today.getDay()];</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">star</span>(<span class="params">num</span>) </span>&#123;</span><br><span class="line">    <span class="keyword">var</span> result = <span class="string">&quot;&quot;</span>;</span><br><span class="line">    <span class="keyword">var</span> i = <span class="number">0</span>;</span><br><span class="line">    <span class="keyword">while</span> (i &lt; num) &#123;</span><br><span class="line">        result += <span class="string">&quot;★&quot;</span>;</span><br><span class="line">        i++;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">while</span>(i &lt; <span class="number">5</span>) &#123;</span><br><span class="line">        result += <span class="string">&quot;☆&quot;</span>;</span><br><span class="line">        i++;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> result;</span><br><span class="line">&#125; </span><br><span class="line"></span><br><span class="line"><span class="comment">// 生成今日运势</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">pickTodaysLuck</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">  <span class="keyword">var</span> _activities = filter(activities);</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">var</span> numGood = random(iday, <span class="number">98</span>) % <span class="number">3</span> + <span class="number">2</span>;</span><br><span class="line">    <span class="keyword">var</span> numBad = random(iday, <span class="number">87</span>) % <span class="number">3</span> + <span class="number">2</span>;</span><br><span class="line">    <span class="keyword">var</span> eventArr = pickRandomActivity(_activities, numGood + numBad);</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">var</span> specialSize = pickSpecials();</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; numGood; i++) &#123;</span><br><span class="line">        addToGood(eventArr[i]);</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; numBad; i++) &#123;</span><br><span class="line">        addToBad(eventArr[numGood + i]);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 去掉一些不合今日的事件</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">filter</span>(<span class="params">activities</span>) </span>&#123;</span><br><span class="line">    <span class="keyword">var</span> result = [];</span><br><span class="line">    </span><br><span class="line">    <span class="comment">// 周末的话，只留下 weekend = true 的事件</span></span><br><span class="line">    <span class="keyword">if</span> (isWeekend()) &#123;</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; activities.length; i++) &#123;</span><br><span class="line">            <span class="keyword">if</span> (activities[i].weekend) &#123;</span><br><span class="line">                result.push(activities[i]);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">return</span> result;</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">return</span> activities;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">isWeekend</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> today.getDay() == <span class="number">0</span> || today.getDay() == <span class="number">6</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 添加预定义事件</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">pickSpecials</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">    <span class="keyword">var</span> specialSize = [<span class="number">0</span>,<span class="number">0</span>];</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; specials.length; i++) &#123;</span><br><span class="line">        <span class="keyword">var</span> special = specials[i];</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">if</span> (iday == special.date) &#123;</span><br><span class="line">            <span class="keyword">if</span> (special.type == <span class="string">&#x27;good&#x27;</span>) &#123;</span><br><span class="line">                specialSize[<span class="number">0</span>]++;</span><br><span class="line">                addToGood(&#123;<span class="attr">name</span>: special.name, <span class="attr">good</span>: special.description&#125;);</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                specialSize[<span class="number">1</span>]++;</span><br><span class="line">                addToBad(&#123;<span class="attr">name</span>: special.name, <span class="attr">bad</span>: special.description&#125;);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">return</span> specialSize;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 从 activities 中随机挑选 size 个</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">pickRandomActivity</span>(<span class="params">activities, size</span>) </span>&#123;</span><br><span class="line">    <span class="keyword">var</span> picked_events = pickRandom(activities, size);</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; picked_events.length; i++) &#123;</span><br><span class="line">        picked_events[i] = parse(picked_events[i]);</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">return</span> picked_events;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 从数组中随机挑选 size 个</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">pickRandom</span>(<span class="params">array, size</span>) </span>&#123;</span><br><span class="line">    <span class="keyword">var</span> result = [];</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; array.length; i++) &#123;</span><br><span class="line">        result.push(array[i]);</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> j = <span class="number">0</span>; j &lt; array.length - size; j++) &#123;</span><br><span class="line">        <span class="keyword">var</span> index = random(iday, j) % result.length;</span><br><span class="line">        result.splice(index, <span class="number">1</span>);</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">return</span> result;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 解析占位符并替换成随机内容</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">parse</span>(<span class="params">event</span>) </span>&#123;</span><br><span class="line">    <span class="keyword">var</span> result = &#123;<span class="attr">name</span>: event.name, <span class="attr">good</span>: event.good, <span class="attr">bad</span>: event.bad&#125;;  <span class="comment">// clone</span></span><br><span class="line">    </span><br><span class="line">    <span class="keyword">if</span> (result.name.indexOf(<span class="string">&#x27;%v&#x27;</span>) != -<span class="number">1</span>) &#123;</span><br><span class="line">        result.name = result.name.replace(<span class="string">&#x27;%v&#x27;</span>, varNames[random(iday, <span class="number">12</span>) % varNames.length]);</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">if</span> (result.name.indexOf(<span class="string">&#x27;%t&#x27;</span>) != -<span class="number">1</span>) &#123;</span><br><span class="line">        result.name = result.name.replace(<span class="string">&#x27;%t&#x27;</span>, tools[random(iday, <span class="number">11</span>) % tools.length]);</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">if</span> (result.name.indexOf(<span class="string">&#x27;%l&#x27;</span>) != -<span class="number">1</span>) &#123;</span><br><span class="line">        result.name = result.name.replace(<span class="string">&#x27;%l&#x27;</span>, (random(iday, <span class="number">12</span>) % <span class="number">247</span> + <span class="number">30</span>).toString());</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">return</span> result;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 添加到“宜”</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">addToGood</span>(<span class="params">event</span>) </span>&#123;</span><br><span class="line">    $(<span class="string">&#x27;.good .content ul&#x27;</span>).append(<span class="string">&#x27;&lt;li&gt;&lt;div class=&quot;name&quot;&gt;&#x27;</span> + event.name + <span class="string">&#x27;&lt;/div&gt;&lt;div class=&quot;description&quot;&gt;&#x27;</span> + event.good + <span class="string">&#x27;&lt;/div&gt;&lt;/li&gt;&#x27;</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 添加到“不宜”</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">addToBad</span>(<span class="params">event</span>) </span>&#123;</span><br><span class="line">    $(<span class="string">&#x27;.bad .content ul&#x27;</span>).append(<span class="string">&#x27;&lt;li&gt;&lt;div class=&quot;name&quot;&gt;&#x27;</span> + event.name + <span class="string">&#x27;&lt;/div&gt;&lt;div class=&quot;description&quot;&gt;&#x27;</span> + event.bad + <span class="string">&#x27;&lt;/div&gt;&lt;/li&gt;&#x27;</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">$(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (is_someday()) &#123;<span class="built_in">document</span>.body.className = <span class="string">&#x27;someday&#x27;</span>&#125;;</span><br><span class="line">    $(<span class="string">&#x27;.date&#x27;</span>).html(getTodayString());</span><br><span class="line">    $(<span class="string">&#x27;.direction_value&#x27;</span>).html(directions[random(iday, <span class="number">2</span>) % directions.length]);</span><br><span class="line">    $(<span class="string">&#x27;.drink_value&#x27;</span>).html(pickRandom(drinks,<span class="number">2</span>).join(<span class="string">&#x27;，&#x27;</span>));</span><br><span class="line">    $(<span class="string">&#x27;.goddes_value&#x27;</span>).html(star(random(iday, <span class="number">6</span>) % <span class="number">5</span> + <span class="number">1</span>));</span><br><span class="line">    pickTodaysLuck();</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>

<p>里面的内容也可自定义，像这样：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;<span class="attr">name</span>:<span class="string">&quot;上B站&quot;</span>, <span class="attr">good</span>:<span class="string">&quot;来看看White_mu今天更新了什么&quot;</span>,<span class="attr">bad</span>:<span class="string">&quot;White_mu根本没更新&quot;</span>, <span class="attr">weekend</span>: <span class="literal">true</span>&#125;,</span><br></pre></td></tr></table></figure>

<p>创建<code>Calender.css</code>：</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">body</span> * &#123;</span><br><span class="line">	<span class="attribute">font-family</span>:<span class="string">&quot;Consolas&quot;</span>,<span class="string">&quot;Microsoft Yahei&quot;</span>, Arial, sans-serif;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-tag">body</span> &#123;</span><br><span class="line">	<span class="attribute">background</span>: white;</span><br><span class="line">	<span class="attribute">margin</span>: <span class="number">0</span>;</span><br><span class="line">	<span class="attribute">padding</span>: <span class="number">0</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.container</span> &#123;</span><br><span class="line">	<span class="comment">/*width: 320px;*/</span></span><br><span class="line">	<span class="attribute">margin</span>: <span class="number">0</span> auto <span class="number">50px</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.container</span>&gt;<span class="selector-class">.title</span> &#123;</span><br><span class="line">	<span class="attribute">color</span>: <span class="number">#bbb</span>;</span><br><span class="line">	<span class="attribute">font-weight</span>: bold;</span><br><span class="line">	<span class="attribute">margin-bottom</span>: <span class="number">10px</span>;</span><br><span class="line">	<span class="attribute">background</span>: <span class="number">#555</span>;</span><br><span class="line">	<span class="attribute">padding</span>: <span class="number">5px</span> <span class="number">15px</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.adlink</span> &#123;</span><br><span class="line">	<span class="attribute">text-align</span>: center;</span><br><span class="line">	<span class="attribute">font-size</span>: <span class="number">11pt</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.adlink</span> <span class="selector-tag">a</span> &#123;</span><br><span class="line">	<span class="attribute">text-decoration</span>: none;</span><br><span class="line">	<span class="attribute">display</span>:block;</span><br><span class="line">	<span class="attribute">color</span>: <span class="number">#666</span>;</span><br><span class="line">	<span class="attribute">font-weight</span>: bold;</span><br><span class="line">	<span class="attribute">margin-bottom</span>: <span class="number">10px</span>;</span><br><span class="line">	<span class="attribute">background</span>: <span class="number">#eee</span>;</span><br><span class="line">	<span class="attribute">border</span>: <span class="number">1px</span> solid <span class="number">#ddd</span>;</span><br><span class="line">	<span class="attribute">border-radius</span>: <span class="number">4px</span>;</span><br><span class="line">	<span class="attribute">padding</span>: <span class="number">10pt</span>;</span><br><span class="line">	<span class="attribute">margin-top</span>: <span class="number">10pt</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.date</span>&#123;</span><br><span class="line">	<span class="attribute">font-size</span>:<span class="number">17pt</span>;</span><br><span class="line">	<span class="attribute">font-weight</span>: bold;</span><br><span class="line">	<span class="attribute">line-height</span>: <span class="number">30pt</span>;</span><br><span class="line">	<span class="attribute">text-align</span>: center;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.split</span>, <span class="selector-class">.clear</span> &#123;</span><br><span class="line">	<span class="attribute">clear</span>: both;</span><br><span class="line">	<span class="attribute">height</span>: <span class="number">1px</span>;</span><br><span class="line">	<span class="attribute">overflow-y</span>: hidden;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.good</span>, <span class="selector-class">.bad</span> &#123;</span><br><span class="line">	<span class="attribute">clear</span>: both;</span><br><span class="line">	<span class="attribute">position</span>: relative;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.bad</span> &#123;</span><br><span class="line">	<span class="comment">/*top: -1px;*/</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.good</span> <span class="selector-class">.title</span>, <span class="selector-class">.bad</span> <span class="selector-class">.title</span> &#123;</span><br><span class="line">	<span class="attribute">float</span>: left;</span><br><span class="line">	<span class="attribute">width</span>: <span class="number">100px</span>;</span><br><span class="line">	<span class="attribute">font-weight</span>: bold;</span><br><span class="line">	<span class="attribute">text-align</span>: center;</span><br><span class="line">	<span class="attribute">font-size</span>: <span class="number">30pt</span>;</span><br><span class="line">	<span class="attribute">position</span>:absolute;</span><br><span class="line">	<span class="attribute">top</span>:<span class="number">0</span>;</span><br><span class="line">	<span class="attribute">bottom</span>:<span class="number">0</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.good</span> <span class="selector-class">.title</span>&gt;<span class="selector-tag">table</span>, <span class="selector-class">.bad</span> <span class="selector-class">.title</span>&gt;<span class="selector-tag">table</span> &#123;</span><br><span class="line">	<span class="attribute">position</span>:absolute;</span><br><span class="line">	<span class="attribute">width</span>:<span class="number">100%</span>;</span><br><span class="line">	<span class="attribute">height</span>:<span class="number">100%</span>;</span><br><span class="line">	<span class="attribute">border</span>:none;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.good</span> <span class="selector-class">.title</span> &#123;</span><br><span class="line">	<span class="attribute">background</span>: <span class="number">#ffee44</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.someday</span> <span class="selector-class">.good</span> <span class="selector-class">.title</span> &#123;</span><br><span class="line">	<span class="attribute">background</span>: <span class="number">#aaaaaa</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.bad</span> <span class="selector-class">.title</span> &#123;</span><br><span class="line">	<span class="attribute">background</span>: <span class="number">#ff4444</span>;</span><br><span class="line">	<span class="attribute">color</span>: <span class="number">#fff</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.someday</span> <span class="selector-class">.bad</span> <span class="selector-class">.title</span> &#123;</span><br><span class="line">	<span class="attribute">background</span>: <span class="number">#666666</span>;</span><br><span class="line">	<span class="attribute">color</span>: <span class="number">#fff</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.good</span> <span class="selector-class">.content</span>, <span class="selector-class">.bad</span> <span class="selector-class">.content</span> &#123;</span><br><span class="line">	<span class="attribute">margin-left</span>: <span class="number">115px</span>;</span><br><span class="line">	<span class="attribute">padding-right</span>: <span class="number">10px</span>;</span><br><span class="line">	<span class="attribute">padding-top</span>: <span class="number">1px</span>;</span><br><span class="line">	<span class="attribute">font-size</span>:<span class="number">15pt</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.someday</span> <span class="selector-class">.good</span> &#123;</span><br><span class="line">	<span class="attribute">background</span>: <span class="number">#dddddd</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.someday</span> <span class="selector-class">.bad</span> &#123;</span><br><span class="line">	<span class="attribute">background</span>: <span class="number">#aaaaaa</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.good</span> &#123;</span><br><span class="line">	<span class="attribute">background</span>: <span class="number">#ffffaa</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.bad</span> &#123;</span><br><span class="line">	<span class="attribute">background</span>: <span class="number">#ffddd3</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.content</span> <span class="selector-tag">ul</span> &#123;</span><br><span class="line">	<span class="attribute">list-style</span>: none;</span><br><span class="line">	<span class="attribute">margin</span>:<span class="number">10px</span> <span class="number">0</span> <span class="number">0</span>;</span><br><span class="line">	<span class="attribute">padding</span>:<span class="number">0</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.content</span> <span class="selector-tag">ul</span> <span class="selector-tag">li</span> &#123;</span><br><span class="line">	<span class="attribute">line-height</span>:<span class="number">150%</span>;</span><br><span class="line">	<span class="attribute">font-size</span>: <span class="number">15pt</span>;</span><br><span class="line">	<span class="attribute">font-weight</span>: bold;</span><br><span class="line">	<span class="attribute">color</span>: <span class="number">#444</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.content</span> <span class="selector-tag">ul</span> <span class="selector-tag">li</span> <span class="selector-tag">div</span><span class="selector-class">.description</span> &#123;</span><br><span class="line">	<span class="attribute">font-size</span>: <span class="number">11pt</span>;</span><br><span class="line">	<span class="attribute">font-weight</span>: normal;</span><br><span class="line">	<span class="attribute">color</span>: <span class="number">#777</span>;</span><br><span class="line">	<span class="attribute">line-height</span>: <span class="number">110%</span>;</span><br><span class="line">	<span class="attribute">margin-bottom</span>: <span class="number">10px</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.line-tip</span> &#123;</span><br><span class="line">	<span class="attribute">font-size</span>: <span class="number">11pt</span>;</span><br><span class="line">	<span class="attribute">margin-top</span>: <span class="number">10px</span>;</span><br><span class="line">	<span class="attribute">margin-left</span>: <span class="number">10px</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.direction_value</span> &#123;</span><br><span class="line">	<span class="attribute">color</span>:<span class="number">#4a4</span>;</span><br><span class="line">	<span class="attribute">font-weight</span>: bold;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.someday</span> <span class="selector-class">.direction_value</span> &#123;</span><br><span class="line">	<span class="attribute">color</span>:<span class="number">#888</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.goddes_value</span> &#123;</span><br><span class="line">	<span class="attribute">color</span>: <span class="number">#f87</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.someday</span> <span class="selector-class">.goddes_value</span> &#123;</span><br><span class="line">	<span class="attribute">color</span>: <span class="number">#777</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.comment</span> &#123;</span><br><span class="line">	<span class="attribute">margin-top</span>: <span class="number">50px</span>;</span><br><span class="line">	<span class="attribute">font-size</span>: <span class="number">11pt</span>;</span><br><span class="line">	<span class="attribute">margin-left</span>: <span class="number">10px</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.comment</span> <span class="selector-tag">ul</span> &#123;</span><br><span class="line">	<span class="attribute">margin-left</span>: <span class="number">0</span>;</span><br><span class="line">	<span class="attribute">padding-left</span>: <span class="number">20px</span>;</span><br><span class="line">	<span class="attribute">color</span>: <span class="number">#999</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h1 id="应用："><a href="#应用：" class="headerlink" title="应用："></a>应用：</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo clean</span><br><span class="line">hexo g</span><br><span class="line">hexo s <span class="comment">#看看效果</span></span><br></pre></td></tr></table></figure>

<p>在local:4000中进入到你刚才创建的<code>local:4000/.../ProgrammersYellowCalender.htm</code>看看效果吧，别忘了在主页添加超链接</p>
<p>来看看我的：<a href="https://muspace.top/lab/ProgrammersYellowCalender">程序员老黄历</a></p>
<p>封面PixivID: 78413548</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:WhitemuTeam@outlook.com">White_mu</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://muspace.top/posts/54870/">https://muspace.top/posts/54870/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://muspace.top" target="_blank">沐の空间</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/hexo/">hexo</a></div><div class="post_share"><div class="social-share" data-image="https://cdn.jsdelivr.net/gh/WhitemuTeam/web-img/img/78413548.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button button--animated"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://cdn.jsdelivr.net/gh/WhitemuTeam/web-img/WeChat.png" target="_blank"><img class="post-qr-code-img" src="https://cdn.jsdelivr.net/gh/WhitemuTeam/web-img/WeChat.png" alt="wechat"/></a><div class="post-qr-code-desc">wechat</div></li><li class="reward-item"><a href="https://cdn.jsdelivr.net/gh/WhitemuTeam/web-img/alipay.png" target="_blank"><img class="post-qr-code-img" src="https://cdn.jsdelivr.net/gh/WhitemuTeam/web-img/alipay.png" alt="alipay"/></a><div class="post-qr-code-desc">alipay</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/posts/37314/"><img class="prev-cover" src="https://inews.gtimg.com/newsapp_bt/0/7172099764/641" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">【转载】那只两年前骗干了我们眼泪的兔子，你还在吗?</div></div></a></div><div class="next-post pull-right"><a href="/posts/56762/"><img class="next-cover" src="https://cdn.jsdelivr.net/gh/WhitemuTeam/web-img/img/90399055.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Plan list maker使用说明</div></div></a></div></nav><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="waline-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%9C%A8%E4%BD%A0%E7%9A%84hexo%E5%8D%9A%E5%AE%A2%E4%B8%8A%E4%BD%BF%E7%94%A8%E2%80%9C%E7%A8%8B%E5%BA%8F%E5%91%98%E8%80%81%E9%BB%84%E5%8E%86%E2%80%9D"><span class="toc-number">1.</span> <span class="toc-text">在你的hexo博客上使用“程序员老黄历”</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%AF%BC%E5%85%A5%EF%BC%9A"><span class="toc-number">2.</span> <span class="toc-text">导入：</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%BA%94%E7%94%A8%EF%BC%9A"><span class="toc-number">3.</span> <span class="toc-text">应用：</span></a></li></ol></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2021 By White_mu</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">单程孤舟，出云入霞，如歌如吟。</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function loadWaline () {
  function initWaline () {
    let initData = {
      el: '#waline-wrap',
      serverURL: 'https://mywaline-kohl.vercel.app',
      avatar: 'monsterid',
      path: location.pathname,
      emojiCDN: 'https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/bilibili',
      emojiMaps: "",
    }
    
    if (true) {
      const otherData = {"langMode":{"admin":"沐沐"},"dark":"auto","emoji":["https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/bilibili","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/weibo"]}
      initData = Object.assign(initData, otherData)
    }
    
    const waline = new Waline(initData)
  }

  if (typeof Waline === 'function') initWaline() 
  else getScript('https://cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js').then(initWaline)
}

if ('Waline' === 'Waline' || !false) {
  if (false) btf.loadComment(document.getElementById('waline-wrap'),loadWaline)
  else setTimeout(loadWaline, 0)
} else {
  function loadOtherComment () {
    loadWaline()
  }
}</script></div><link rel="stylesheet" href="/css/muspace.css"><script async data-pjax src="/js/randombg.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --><script data-pjax>
  function card_artitalk_injector_config(){
    var parent_div_git = document.getElementsByClassName('sticky_layout')[0];
    var item_html = '<div class="card-widget card-shuo"><div class="card-content" style="height:auto;min-height:280px;"><div class="item-headline"><i class="fas fa-comments"></i><span><a href="/artitalk/" title="artitalk page link">碎碎念</a></span><a id="cardVisual" style="cursor:pointer;float:right" onclick="cardVisual()">编辑</a></div><div id="artitalk_main" style="width:100%;height:100%;padding:1px"></div></div></div>';
    console.log('已挂载card_artitalk');
    parent_div_git.insertAdjacentHTML("afterbegin",item_html);
    (()=>{
      const init = () => {
        new Artitalk(Object.assign({
          appId: '0Iwjb3hh2nIyE2rXULy07JJI-MdYXbMMI',
          appKey: 'WJl1nKnTBO8oq4OhD50MRYBX',
        }, {"serverURL":"https://0iwjb3hh.api.lncldglobal.com","lang":"zh","pageSize":1,"color1":"#49b1f5","color2":"#00c4b6","atEmoji":{"Mafumafu1":"https://cdn.jsdelivr.net/gh/GamerNoTitle/ValineCDN@master/Mafumafu/199749454.png","Mafumafu2":"https://cdn.jsdelivr.net/gh/GamerNoTitle/ValineCDN@master/Mafumafu/199749455.png"}} ))
      }
      if (typeof Artitalk === 'function') {
        init()
      } else {
        getScript('https://cdn.jsdelivr.net/npm/artitalk').then(init)
      }
    })()
    }
  var elist = '/artitalk/,/posts/'.split(',');
  var cpage = location.pathname;
  var epage = 'all';
  var flag = 0;

  for (var i=0;i<elist.length;i++){
    if (cpage.includes(elist[i])){
      flag++;
    }
  }

  if ((epage ==='all')&&(flag == 0)){
    card_artitalk_injector_config();
  }
  else if (epage === cpage){
    card_artitalk_injector_config();
  }
  </script><script async src="https://cdn.jsdelivr.net/npm/hexo-butterfly-artitalk-pro/lib/card_visual.js"></script><!-- hexo injector body_end end --></body></html>